/**
 * @file fish.h
 * @brief Header file for the fish plugin, contains definitions of private structs.
 * @author Klemen Strnisa <strnisa.klemen@gmail.com>
 */

#ifndef __FISH_H__
#define __FISH_H__

#include <libxfce4panel/xfce-panel-plugin.h>


/**
 * @brief User settings for the plugin.
 *
 * Plugin parameters that are accessible from the panel settings menu:
 * 	- name of the fish (default "Wanda")
 * 	- command that is issued by the fish (default "fortune")
 *
 * The struct also holds associated gui elements.
 */
typedef struct {
    gchar           *command;           /**< Command issued each time the fish is clicked. */
    gchar           *name;              /**< Name of the fish. */

    GtkWidget       *command_setting;   /**< GtkEntry widget holding the @c fish_command. */
    GtkWidget       *name_setting;      /**< GtkEnty widget holding the @c fish_name. */
} FishSettings;


/**
 * @brief Private context for the plugin.
 *
 * The context consists of the information necessary for the XFCE panel, gui
 * elements, user settings (inside @c fish_settings) and internal information.
 */
typedef struct {
    XfcePanelPlugin *plugin;            /**< An XFCE panel plugin struct. */

    GtkWidget       *fortune_window;    /**< Fortune dialog window. */
    GtkTextBuffer   *fortune_buffer;    /**< Fortune command response buffer. */
    GtkWidget       *fortune_label;     /**< Label in @c forune_window. */
    GtkWidget       *ebox;              /**< Event box (around @c image) that listens for mouse clicks on the fish. */
    GtkWidget       *image;             /**< Current fish image (changes with timer ticks). */
    GdkPixbuf       **frames;           /**< Array of fish animation pixbufs (eight pixbufs). */

    FishSettings    settings;           /**< Collection of settings for the fish plugin. */

    gint            current_frame;      /**< Number of current frame (from 0 to 7).*/
    gint            size;               /**< Size in the relevant dimension (width for horizontal and height for vertical panel orientaion).*/
    guint           timer;              /**< Timer for periodic update of @c image with the next element from @a frames. */
    gint            pixmap_width;       /**< Width of drawing area for @c image, also size of ring buffer, does not include border size. */
    gint            pixmap_height;      /**< Height of drawing area for @c image, does not include border size. */
    gchar           *title_text;        /**< @c fortune_window title text.*/
    gchar           *label_text;        /**< @c fortune_label text.*/
} FishPlugin;

#endif /* __FISH_H__ */
